<html><head>
  <meta charset="utf-8">
<#assign base=request.contextPath  />
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title></title>
  <link rel="stylesheet" href="${base}/js/layui/css/layui.css" media="all">
    <script src="${base}/js/jquery.min.js"></script>
</head>
<style type="text/css">
  
  #zong{
     padding: 30px;
  }
  .biankuang{
    border: solid 4px #ccc;
  }
  td{
     border: solid 1px #ccc;
  }
</style>
<body>
<input type="hidden" id="homeId" value="${homeId}">
  <div id="zong" class="layui-form">
      <button onclick="javascript:window.print()">打印</button>
 <table class="biankuang" width="810" border="1">
     <tr>
         <td align="center" height="77px">套餐消费</td>
        <td align="center">
            <input style="border: none" name="phone" id="mealPrice">
        </td>
  </tr>
  <tr>
    <td  align="center">产康消费</td>
    <td align="center">
      <input style="border: none" name="phone" id="mealPrice">
    </td>
  </tr>
  <tr>
    <td height="50" align="center">套餐外服务消费</td>
    <td><table width="250" cellspacing="0" cellpadding="0" id="EWpayName">
    </table></td>

  </tr>
  <tr>
    <td align="center" height="77">合计</td>
      <td height="77" id="sum" style="text-align:center;">  </td>
  </tr>
</table>
</div>
<script src="${base}/js/layui/layui.js" charset="utf-8"></script>

<script>
layui.use(['form','element','laydate','table'], function(){
  var form = layui.form;
  var laydate = layui.laydate;
  var table = layui.table;   
  var layer = layui.layer;
  var element = layui.element; 
});
$.ajax({
    type:"POST",
    url:"${base}/moenyDetailed/MoenyInfoData",
    data:{"homeId":$("#homeId").val()},
    success : function(data){
    $("#roomName").val(data[0].roomName);
    $("#userName").val(data[0].orderName);
    $("#mealName").val(data[0].mealName);
        if(data[0].mealPrice!=null){
            $("#mealPrice").val(data[0].mealPrice+"元");
        }

       var htm="";
        var htm2="";
        var ewNameHtm="";
        var ewPriceHtm="";
        var sum=0;
        for(var i=0;i<data.length;i++){
            if(data[i].projectName!=null) {
                sum+=data[i].sumMoeny;
                if(data[i].projectId!=null&&data[i].projectId!=""){
                    //产康名字
                    htm += ' <tr>' +
                            '<td height="77" align="center">' +
                            '<div class="layui-inline">' +

                            '<div class="layui-input-inline">' +
                            '<input   class="layui-input" type="text" value="' + data[i].projectName + '('+data[i].count+'次)">' +


                            '</div>' +
                            '</div></td>' +
                            '</tr>'

                    //产康价格
                    htm2+='<tr>'+
                            '<td height="77" align="center">  <div class="layui-inline">'+
                            '<div class="layui-input-inline">'+
                            '<input name="phone"  value="' + data[i].projectMoney + '元" autocomplete="off" class="layui-input">'+
                            '</div>'+
                            '</div></td>'+
                            '</tr>'
                }else{
                    ewNameHtm+='<tr>'+
                            '<td height="77" align="center" >'+
                            '<div class="layui-inline">'+

                           '<div class="layui-input-inline">'+
                            '<select name="modules" lay-verify="required" lay-search="">'+
                            '<input  class="layui-input"  type="text" value="' + data[i].projectName + '('+data[i].count+'次)">' +
                            '</div>'+
                            '</div></td>'+
                            '</tr>'

                    ewPriceHtm+='<tr>'+
                            '<td height="77" align="center">  <div class="layui-inline">'+
                            '<div class="layui-input-inline">'+
                            '<input name="phone" class="layui-input" value="' + data[i].projectMoney + '元" autocomplete="off" >'+
                            '</div>'+
                            '</div></td>'+
                            '</tr>'
                }



            }
        }
    $("#projectPay").append(htm);
    $("#projectPrice").append(htm2);
    $("#EWpayName").append(ewNameHtm);
    $("#EWpayPrice").append(ewPriceHtm);
    $("#sum").html((sum+data[0].mealPrice)+"元");

    }
});

</script>
</body>
</html>